//
//  UIColorSampleViewController.m
//  CategoryKit
//
//  Created by 刘彬 on 2016/12/21.
//  Copyright © 2016年 likuifeng. All rights reserved.
//

#import "UIColorSampleViewController.h"

@interface UIColorSampleViewController ()

@property (nonatomic, strong) UIView *view1;
@property (nonatomic, strong) UIView *view2;
@property (nonatomic, strong) UIView *view3;
@property (nonatomic, strong) UIView *view4;
@property (nonatomic, strong) UIView *view5;
@property (nonatomic, strong) UIView *view6;

@end

@implementation UIColorSampleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.view1];
    [self.view addSubview:self.view2];
    [self.view addSubview:self.view3];
    [self.view addSubview:self.view4];
    [self.view addSubview:self.view5];
    [self.view addSubview:self.view6];
    
    CGFloat margin = (self.view.ff_height - 20 - 44 -50*6)/7;
    
    [self.view1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(margin+20+44);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@50);
    }];
    
    [self.view2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view1.mas_bottom).offset(margin);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@50);
    }];
    
    [self.view3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view2.mas_bottom).offset(margin);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@50);
    }];
    
    [self.view4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view3.mas_bottom).offset(margin);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@50);
    }];
    
    [self.view5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view4.mas_bottom).offset(margin);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@50);
    }];
    
    [self.view6 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view5.mas_bottom).offset(margin);
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.height.equalTo(@50);
    }];
}


- (UIView *)view1{
    if (_view1 == nil) {
        _view1 = [UIView ff_viewWithColor:[UIColor ff_colorWithHex:0x000000 alpha:125/255]];
    }
    return _view1;
}

- (UIView *)view2{
    if (_view2 == nil) {
        _view2 = [UIView ff_viewWithColor:[UIColor ff_colorWithHex:0x000000 alpha:125/255.0]];
    }
    return _view2;
}

- (UIView *)view3{
    if (_view3 == nil) {
        _view3 = [UIView ff_viewWithColor:[UIColor ff_colorWithHex:0x000000 alpha:125/255.]];
    }
    return _view3;
}

- (UIView *)view4{
    if (_view4 == nil) {
        _view4 = [UIView ff_viewWithColor:[UIColor ff_colorWithHex:0x000000 alpha:125./255.]];
    }
    return _view4;
}

- (UIView *)view5{
    if (_view5 == nil) {
        _view5 = [UIView ff_viewWithColor:[UIColor ff_colorWithHex:0x000000 alpha:125/255.f]];
    }
    return _view5;
}

- (UIView *)view6{
    if (_view6 == nil) {
        _view6 = [UIView ff_viewWithColor:[UIColor ff_colorWithHex:0x000000 alpha:125.f/255]];
    }
    return _view6;
}

@end
